<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page     import="controller.NewOrder"%>
<%@ page     import="hibernate.Orderstab"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'TestWebSocket.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
	<script type="text/javascript">
	function confirmOrder(){
		var result = confirm('是否接单?');  
    	if(result){  
        	alert('接单成功！'); 
        	//调用接口并重新载入页面 
    	}else{  
        	alert('取消接单！');  
    	}  	
	}
	
	
		function check_all(cName) {

			var checkboxs = document.getElementsByName(cName);
			for (var i = 0; i < checkboxs.length; i += 1) {
				checkboxs[i].checked = true;
			}
		}
		
		function uncheck_all(cName) {

			var checkboxs = document.getElementsByName(cName);
			for (var i = 0; i < checkboxs.length; i += 1) {
				checkboxs[i].checked = false;
			}
		}
	</script>
	

  </head>
  
  <body style="background-image:url('images/bg1.gif')">
         <h4>未处理订单列表 </h4>
         <form action="orderAcceptAction.action" method="get">
         <table border="1">
   <tr>
   <td>选择</td>
   <td>订单ID</td>
   <td>预定车位数量</td>
   <td>到达时间</td>
   <td>预定时间</td>
   </tr>
   <%
     NewOrder neworder=new NewOrder();
     
         List<Orderstab> list=neworder.untreatedOrders((Integer)request.getSession().getAttribute("parkID"));
         if(list!=null){
         for(Orderstab ft:list){%>
         
          <tr>
          	  <td><input type="checkbox" name="check" value="<%= ft.getUuid()%>"/> </td>
         	  <td><%= ft.getUuid()%></td>
              <td><%= ft.getOrderNumber()%></td>
              <td><%= ft.getPushTime()%></td>
              <td><%= ft.getOrderTime()%></td>       
          </tr>
         <% }%>
         
     <% } %>
    
       </table>
       <button type="button" onclick="check_all('check');">全选</button>
       <button type="button" onclick="uncheck_all('check');">取消</button>
       <input  type="submit" value="确认"/>
       </form>
   </body>
</html>
